package com.scraper.articles.web.model;

public enum SourceEnum {

    SEEKING_ALPHA("seekingalpha.com"),
    STOCK_CHARTS("stockcharts.com");

    private final String name;

    private SourceEnum(String name) {
        this.name = name;
    }

    public static SourceEnum getEnumByName(String name) {
        for (SourceEnum sourceEnum : SourceEnum.values()) {
            if (sourceEnum.name.equalsIgnoreCase(name)) {
                return sourceEnum;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return name;
    }

    public String getName() {
        return name;
    }
}
